-- boomboomwawawaw: -- local owner = owner ---------------------- -- Services local TweenS = game:service("TweenService") ------------- -- UTILS -- local Utils = {} function Utils:Create(InstData, Props) local Obj = Instance.new(InstData[1], InstData[2]) for k, v in pairs (Props) do Obj[k] = v end; return Obj end function Utils:CNR(cf) -- CFrameNoRotate return CFrame.new(cf.x,cf.y,cf.z) end -- LEGACY FUNCTIONS WITH ADDED FEATURES function Utils:ezweld(p, a, b, cf, c1) local weld = Instance.new("Weld",p) weld.Part0 = a weld.Part1 = b weld.C0 = cf if c1 then weld.C1 = c1 end return weld end function Utils:NewSound(p, id, pit, vol, loop, autoplay) local Sound = Instance.new("Sound",p) Sound.Pitch = pit Sound.Volume = vol Sound.SoundId = "rbxassetid://" ..id Sound.Looped = loop if autoplay then Sound:Play() end return Sound end ----------- local Tool = Utils:Create({"Tool", owner.Backpack}, { Name = "this aint my dad this is a cell phone!!!!!!", Grip = CFrame.new(0.45, -0.1, 0.8) }); local Handle = Utils:Create({"Part", Tool}, { Name = "Handle", BrickColor = BrickColor.White() }); Utils:Create({"SpecialMesh", Handle}, { MeshId = "rbxassetid://5947035791", TextureId = "rbxassetid://5947035851", Scale = Vector3.one * .75, }); -- anim stuff -- -- : joints : -- local RS, LS, RH, LH, RJ, NK local DRS, DLS = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, -0, -0) local DRH, DLH = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, -0, -0) local DNK, DRJ = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) local DRS2, DLS2 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), CFrame.new(0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, 1, -0, -0) local DRH2, DLH2 = CFrame.new(0.5, 1, 0, 0, 0, -1, 0, 1, 0, -1, -0, -0), CFrame.new(-0.5, 1, 0, 0, 0, 1, 0, 1, 0, 1, -0, -0) local DNK2, DRJ2 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0), CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) local DFG = Tool.Grip RS = Utils:ezweld(Tool, nil, nil, DRS, DRS2) LS = Utils:ezweld(Tool, nil, nil, DLS, DLS2) RH = Utils:ezweld(Tool, nil, nil, DRH, DRH2) LH = Utils:ezweld(Tool, nil, nil, DLH, DLH2) RJ = Utils:ezweld(Tool, nil, nil, DRJ, DRJ2) NK = Utils:ezweld(Tool, nil, nil, DNK, DNK2) ---------------- local laDATA = {RS = RS, LS = LS, RH = RH, LH = LH, RJ = RJ, NK = NK, GRP = Tool} -- load anim data local function loadAnimation(data) -- compiles an animation local stored = {TWEENS = {}} for _,fr in data do for i,v in fr.joint do local J = laDATA[v.j] if J then local STYLE = (v.ES and Enum.EasingStyle[v.ES]) or Enum.EasingStyle.Linear local DIR = (v.ED and Enum.EasingDirection[v.ED]) or Enum.EasingDirection.InOut if not stored.TWEENS[_] then stored.TWEENS[_] = {} end if J:IsA("Tool") then stored.TWEENS[_][v.j] = { TW = TweenS:Create(J, TweenInfo.new(v.t, STYLE, DIR), {Grip = v.C0}), TIM = fr.time } else stored.TWEENS[_][v.j] = { TW = TweenS:Create(J, TweenInfo.new(v.t, STYLE, DIR), {C0 = v.C0}), TIM = fr.time } end end end end return stored end; local function playAnimation(data) -- loads a compiled animation for i,_ in data.TWEENS do for _,v in _ do if v.TIM > 0 then task.delay(v.TIM, function() v.TW:Cancel() v.TW:Play() end) else v.TW:Cancel() v.TW:Play() end end --print("-------") end end local IDLEANIM = { {time = 0, joint = { { j = "RS", -- joint t = .5, -- time it takes to do thing C0 = DRS * CFrame.new(-.25, -.35, .15) * CFrame.Angles(math.rad(1), math.rad(25), math.rad(75 + 30)), -- c0 ES = "Back" -- easing style }, { j = "GRP", t = .25, C0 = DFG * CFrame.new(-.5, -.5, -1) * CFrame.Angles(0, math.pi, 0), ES = "Linear" } }}, {time = .1, joint = { { j = "GRP", t = .1, C0 = DFG * CFrame.new(-.5, -.1, -1) * CFrame.Angles(math.pi / 2, math.pi, 0), ES = "Linear" } }}, {time = .2, joint = { { j = "GRP", t = .1, C0 = DFG * CFrame.new(-.5, -.1, -1) * CFrame.Angles(math.pi, math.pi, 0), ES = "Linear" } }}, {time = .3, joint = { { j = "GRP", t = .1, C0 = DFG * CFrame.new(-.5, -.1, -1) * CFrame.Angles(-math.pi / 2, math.pi, 0), ES = "Linear" } }}, {time = .4, joint = { { j = "GRP", t = .1, C0 = DFG * CFrame.new(-.5, -.5, -1) * CFrame.Angles(-math.pi / 4, math.pi, 0), ES = "Linear" } }}, {time = .5, joint = { { j = "GRP", t = .1, C0 = DFG * CFrame.new(-.5, -.5, -1) * CFrame.Angles(0, math.pi, 0), ES = "Cubic" } }} }; local THROWANIM = { {time = 0, joint = { { j = "RS", -- joint t = .15, -- time it takes to do thing C0 = DRS * CFrame.new(-.15, -.35, .15) * CFrame.Angles(math.rad(1), math.rad(25), math.rad(75 + 89)), -- c0 ES = "Cubic" -- easing style }, { j = "GRP", t = .15, C0 = DFG * CFrame.new(-.5, -.5, -1) * CFrame.Angles(0, math.pi, 0), ES = "Cubic" } }}, {time = .1, joint = { { j = "RS", -- joint t = .25, -- time it takes to do thing C0 = DRS * CFrame.new(-.1, -.35, .25) * CFrame.Angles(math.rad(1), math.rad(25), math.rad(35)), -- c0 ES = "Back" -- easing style }, { j = "GRP", t = .25, C0 = DFG * CFrame.new(-.5, -.5, -1) * CFrame.Angles(0, math.pi, 0), ES = "Back" } }}, } local loadedIdle local loadedThrow -- tool stuff + anim stuff local char, hum local function SetupChar() char = Tool.Parent local CH = char RS.Part0 = CH:FindFirstChild("Torso"); RS.Part1 = CH:FindFirstChild("Right Arm") hum = CH:FindFirstChildOfClass("Humanoid") end local equips = 0 local function ToolEquip() equips += 1; local equipp = equips local reloadanim = char ~= Tool.Parent SetupChar() -- EQUIP LOGIC if reloadanim then loadedIdle = loadAnimation(IDLEANIM); loadedThrow = loadAnimation(THROWANIM) end Tool.Enabled = false playAnimation(loadedIdle) task.wait(.5) if equipp == equips then Tool.Enabled = true end end local function UnEquip() RJ.C0 = DRJ NK.C0 = DNK RS.C0 = DRS LS.C0 = DLS end Tool.Equipped:connect(ToolEquip) Tool.Unequipped:connect(UnEquip) local announce = Utils:Create({"BillboardGui", Handle}, { Size = UDim2.new(5, 0, 1.5, 0), StudsOffset = Vector3.new(0, 3, 0), }); local text = Utils:Create({"TextBox", announce}, { Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, TextStrokeTransparency = 0, TextColor3 = Color3.new(1, 1, 1), TextScaled = true, Text = "" }); Tool.Activated:connect(function() if not Tool.Enabled then return end; Tool.Enabled = false --text.Text = "This aint my dad This is a cell phone" --task.wait(.5) playAnimation(loadedThrow) task.wait(.225) text.Text = "I threw it on the ground" local CELL = Handle:Clone() CELL.Parent = script; CELL:BreakJoints() CELL.CanCollide = true CELL.Size = Vector3.one CELL.Velocity = -Vector3.yAxis * 50 CELL.Touched:connect(function(hit) if hit.CanCollide and hit.Parent ~= char and hit.Parent.Parent ~= char then for i = 1,20 do local lol = Utils:Create({"Part", script}, { Size = Vector3.one * .25, CFrame = CELL.CFrame, Color = Color3.new(0, 0, 0), Material = "Glass", RotVelocity = Vector3.new(math.random(-500, 500), math.random(-500, 500), math.random(-500, 500)) }); lol.Touched:connect(function(hit) if hit.Parent and hit.Parent ~= char and hit.Parent.Parent ~= char then local hum = hit.Parent:FindFirstChildOfClass("Humanoid") or (hit.Parent and hit.Parent.Parent and hit.Parent.Parent:FindFirstChildOfClass("Humanoid")) if hum then hum.Health -= 1 end end end) game.Debris:AddItem(lol, 3) end CELL:Destroy() end end) Handle.Transparency = 1 task.wait((.35 * 2) - .225) text.Text = "" Handle.Transparency = 0 playAnimation(loadedIdle) task.wait(.5) Tool.Enabled = true end)